﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Windows.Controls.Primitives;

namespace Soket_MMTNC_Client
{
    /// <summary>
    /// Interaction logic for Statistics.xaml
    /// </summary>
    public partial class Statistics : Window
    {
        public Statistics()
        {
            InitializeComponent();
        }

        

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            datePicker1.SelectedDate = DateTime.Today;
        }
        public static string valueofdate = "";
        private void button1_Click(object sender, RoutedEventArgs e)
        {
            if (datePicker1.SelectedDate.ToString() == "")
            {
                MessageBox.Show("Bạn hãy chọn ngày cần thống kê!");
            }
            else
            {
                //DateTime? date = datePicker.SelectedDate;
                //string value = date != null ? date.Value.ToString("yyyy-MM-dd") : null;
                DateTime? date = datePicker1.SelectedDate;
                valueofdate = date.Value.ToString("M/dd/yyyy");
                //MessageBox.Show(value);
                int selec = comboBox1.SelectedIndex;
                switch (selec)
                {
                    case 0:
                        {
                            Report r = new Report();
                            r.ShowInTaskbar = false;
                            r.ShowDialog();
                            break;
                        }
                    case 1:
                        {
                            report2 r = new report2();
                            r.ShowInTaskbar = false;
                            r.ShowDialog();
                            break;
                        }
                    case 2:
                        {
                            report3 r = new report3();
                            r.ShowInTaskbar = false;
                            r.ShowDialog();
                            break;
                        }
                }
                
                
            }
            
        }

        

        
    }
}
